#!/usr/bin/env bash
set -xeuo pipefail

here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

pushd "${here}/../"
  lein install
popd

pushd "${here}"
  if ! lein jank run pass; then
    echo "Bad exit on 'lein jank run pass'"
    exit 1
  fi
  if lein jank run fail; then
    echo "Bad exit on 'lein jank run pass'"
    exit 1
  fi
  if lein jank bad-command; then
    echo "Bad exit on 'lein jank bad-command'"
    exit 1
  fi
popd
